<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en"><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>微盟云谷妙码管理后台</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" th:href="@{/static/favicon.ico}" type="image/x-icon"/>
    <link rel="stylesheet" th:href="@{/static/gamebar_Admin_files/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/static/gamebar_Admin_files/camera.css}">
    <link rel="stylesheet" th:href="@{/static/gamebar_Admin_files/bootstrap-responsive.css}">
    <link rel="stylesheet" th:href="@{/static/gamebar_Admin_files/matrix-login.css}">
    <link th:href="@{/static/gamebar_Admin_files/font-awesome.css}" rel="stylesheet">
    <script type="text/javascript" th:src="@{/static/gamebar_Admin_files/jquery-1.js}"></script>

    <script th:src="@{/static/gamebar_Admin_files/bootstrap.js}"></script>
    <script th:src="@{/static/gamebar_Admin_files/jquery-1_002.js}"></script>
    <script th:src="@{/static/gamebar_Admin_files/jquery.js}"></script>
    <script th:src="@{/static/gamebar_Admin_files/jquery_002.js}"></script>
    <script th:src="@{/static/jquery-form.js}"></script>
    <script th:src="@{/static/gamebar_Admin_files/camera.js}"></script>
    <script th:src="@{/static/gamebar_Admin_files/templatemo_script.js}"></script>
    <script type="text/javascript" th:src="@{/static/gamebar_Admin_files/jquery_003.js}"></script>
    <script type="text/javascript" th:src="@{/static/gamebar_Admin_files/jquery_004.js}"></script>

</head>
<body>

<div style="width:100%;text-align: center;margin: 0 auto;position: absolute;">
    <div id="loginbox">
        <form th:action="@{/login}" method="post" name="loginForm" id="loginForm">
            <div class="control-group normal_text">
                <h3>
                    <img th:src="@{/static/gamebar_Admin_files/guan.png}" alt="Logo" style="height:35px !important">
                </h3>
            </div>
            <div class="control-group">
                <div class="controls">
                    <div class="main_input_box">

                        <span class="add-on bg_lg"><i><img th:src="@{/static/gamebar_Admin_files/user.png}" height="37"></i></span><input name="userName" id="loginname" placeholder="请输入用户名" type="text">
                    </div>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <div class="main_input_box">
                        <span class="add-on bg_ly"><i><img th:src="@{/static/gamebar_Admin_files/suo.png}" height="37"></i></span><input name="userPwd" id="password" placeholder="请输入密码" value="" type="password">
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <div style="width:86%;padding-left:8%;">
                    <span class="pull-right" style="padding-right:3%;"><a href="javascript:quxiao();" class="btn btn-success">取消</a></span> <span class="pull-right"><a onclick="severCheck();" class="flip-link btn btn-info" id="to-recover">登录</a></span>
                </div>
            </div>

        </form>


        <div class="controls">
            <div class="main_input_box">
                <font color="white"><span id="nameerr">Copyright © 2017-2018 微盟云谷股份有限公司
							</span></font>
            </div>
        </div>
    </div>
</div>
<div id="templatemo_banner_slide" class="container_wapper"><!--  style="height: 710px;" -->
    <div class="camera_wrap camera_emboss" id="camera_slide"><!--  style="display: block; height: 710px;" -->
        <div th:attr="data-src=@{/static/gamebar_Admin_files/banner_slide_01.jpg}"></div>
        <div th:attr="data-src=@{/static/gamebar_Admin_files/banner_slide_02.jpg}"></div>
        <div th:attr="data-src=@{/static/gamebar_Admin_files/banner_slide_03.jpg}"></div>
    </div>
    <!-- #camera_wrap_3 -->
</div>

<script type="text/javascript">

    //服务器校验
    function severCheck(){
        if(check()){

            $("#loginForm").ajaxSubmit({
                type : 'POST',
                success: function(data){
                    if("success" == data.result){
                        //saveCookie();
                        window.location.href="[[${#request.getContextPath()}]]/user/index";
                    }else if("usererror" == data.result){
                        $("#loginname").tips({
                            side : 1,
                            msg : "用户名或密码有误",
                            bg : '#FF5080',
                            time : 15
                        });
                        $("#loginname").focus();
                    }
                }
            });
        }
    }



    //客户端校验
    function check() {

        if ($("#loginname").val() == "") {

            $("#loginname").tips({
                side : 2,
                msg : '用户名不得为空',
                bg : '#AE81FF',
                time : 3
            });

            $("#loginname").focus();
            return false;
        } else {
            $("#loginname").val(jQuery.trim($('#loginname').val()));
        }

        if ($("#password").val() == "") {

            $("#password").tips({
                side : 2,
                msg : '密码不得为空',
                bg : '#AE81FF',
                time : 3
            });

            $("#password").focus();
            return false;
        }


        $("#loginbox").tips({
            side : 1,
            msg : '正在登录 , 请稍后 ...',
            bg : '#68B500',
            time : 10
        });

        return true;
    }


    function quxiao() {
        $("#loginname").val('');
        $("#password").val('');
    }

</script>



</body></html>